import pymysql

conn=pymysql.connect(host='localhost',user='root',password='',database='test12',port=3306)
cursor=conn.cursor()

mysql='insert into user(name,age) values("李卓颖","22");'

# mysql="""
# CREATE TABLE user (
# id INT auto_increment PRIMARY KEY ,
# name CHAR(10) NOT NULL UNIQUE,
# age TINYINT NOT NULL
# )ENGINE=innodb DEFAULT CHARSET=utf8;
# """

cursor.execute(mysql)

conn.commit()

conn.close()
